﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>


<h1>Edit | Изменение данных о пользователе:</h1>

<form:form action="${action}" commandName="user"
	modelAttribute="user" method="POST">

	<form:label path="login">Login | Логин:</form:label>
	<form:input path="login" />
	<form:errors path="login" />
	<br />

	<form:label path="password">Password | Пароль:</form:label>
	<form:input path="password" />
	<form:errors path="password" />
	<br />

	<form:label path="name">Name | ФИО:</form:label>
	<form:input path="name" />
	<form:errors path="name" />
	<br />

	<form:label path="email">E-Mail | Адрес электронной почты:</form:label>
	<form:input path="email" />
	<form:errors path="email" />
	<br />

	<form:label path="passportCode">Passport code | № паспорта:</form:label>
	<form:input path="passportCode" />
	<form:errors path="passportCode" />
	<br />

	<form:label path="accessRole">Access role | Права доступа:</form:label><br/>
	<form:select path="accessRole">
	<form:options items="${accessList}" />
	</form:select>
	<form:errors path="accessRole" cssClass="error" />


	<c:if test="${user.userId > 0}">
		<form:label path="userId">ID:</form:label>
		<form:hidden path="userId" /> ${user.userId} <br />
		<br />
	</c:if>

	<c:if test="${user.userId == 0}">
		<form:label path="userId">ID:</form:label>
		<form:input path="userId" />
		<form:errors path="userId" />
		<br />
		<br />
	</c:if>

	<br />
	<br />
	
	<input type="submit" value="Save | Сохранить" />
	<input type="reset" value="Cancel | Отмена" onclick="window.history.back();"/>

</form:form>
